<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>订单支付</title>
<link rel="stylesheet" type="text/css" href="#{$smarty.const.APP}#/View/template/home/css/hui.css" />
</head>
<body style="background:#F4F5F6;">
<header class="hui-header">
  <div id="hui-back"></div>
  <h1>订单支付</h1>
  <div class="hui-header-sreach-txt" onclick=""></div>
</header>
<div class="hui-wrap">
  <div style="margin:20px 0px; margin-bottom:15px;" class="hui-list">
    <div class="row">
	  	<div class="hui-col-4">订单编号：</div>
	  	<div class="hui-col-8">#{$one.ordernumber}#</div>
	  </div>
  </div>
</div>
<input type="hidden" name="member_in_acct" id="member_in_acct" value="#{$one.account}#">
<input type="hidden" name="id" id="member_out_acct_id" value="17">
<div style="padding:10px; padding-top:10px;">
  <button type="button" class="hui-button hui-button-large hui-primary" id="submit">确认支付</button>
</div>
<script type="text/javascript" src="#{$smarty.const.APP}#/View/template/home/js/hui.js" charset="UTF-8"></script> 
<script type="text/javascript" src="#{$smarty.const.APP}#/View/template/home/js/hui-form.js" charset="utf-8"></script> 
<script type="text/javascript">
//初始化表单
hui.formInit();

hui('#submit').click(function(){
    //验证
	var res = huiFormCheck('#form1');
  	 var password_pay = hui('#password_pay').val();
  	 var orderid = '#{$one.id}#';
    //提交
    if(res){
		hui.ajax({
			type : 'POST',
			url : '#{$smarty.const.ACT}#/home/WxProductBuy/product_buy_pay/',
			data : {id:orderid,password_pay:password_pay},
			backType:'json',
			beforeSend : function(){hui.loading();},
			complete : function(){hui.closeLoading();},
			success : function(data){
				if(data.code=='sucess'){
					hui.upToast(data.message);
					var url='#{$smarty.const.ACT}#/home/WxProductOrder/product_order_my_show/';
					window.location.href=url;
				}else{
					hui.upToast(data.message);
				}
				
			},
			error : function(e){
				console.log(JSON.stringify(e));
				hui.iconToast('读取消息失败', 'warn');
			}
		});
	 }
});
</script>
</body>
</html>